import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
//node中的path模块
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: "./",
  resolve: {
    alias: {
      "@": path.resolve("src"),
      components: path.resolve("src", "components"),
      pages: path.resolve("src", "pages"),
    },
  },
  server: {
    port: 8080,
    proxy: {
      "/api": {
        target: "http://chst.vip",
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
});
